From: Paul Durrant Date: Wed, 22 Mar 2017 11:03:54 +0000 (+0100) Subject: x86/viridian: get rid of the magic numbers in CPUID leaves 1 and 2 X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2429 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/?a=commitdiff_plain;h=791260bab71a1c969b17ff77356a8a5f592fad43;p=xen.git x86/viridian: get rid of the magic numbers in CPUID leaves 1 and 2 The numbers correspond to ASCII characters so just use appropriate character strings directly. Signed-off-by: Paul Durrant Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c index a71f9281ae..0155c1ff62 100644 --- a/xen/arch/x86/hvm/viridian.c +++ b/xen/arch/x86/hvm/viridian.c @@ -119,14 +119,16 @@ void cpuid_viridian_leaves(const struct vcpu *v, uint32_t leaf, switch ( leaf ) { case 0: + /* See section 2.4.1 of the specification */ res->a = 0x40000006; /* Maximum leaf */ - res->b = 0x7263694d; /* Magic numbers */ - res->c = 0x666F736F; - res->d = 0x76482074; + memcpy(&res->b, "Micr", 4); + memcpy(&res->c, "osof", 4); + memcpy(&res->d, "t Hv", 4); break; case 1: - res->a = 0x31237648; /* Version number */ + /* See section 2.4.2 of the specification */ + memcpy(&res->a, "Hv#1", 4); break; case 2: